<!DOCTYPE html>
<html lang="zh-CN" data-theme="light" class="winter-theme">
<head>
  <meta charset="UTF-8" />
  <meta
    name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
  />
  <meta name="theme-color" content="#000000">
  <title>加载中~</title>

  <!-- Google Fonts -->
  <link
    href="css/fonts-loli-poppins.css"
    rel="stylesheet"
  />


  <!-- Bootstrap -->
  <link
    rel="stylesheet"
    href="css/bootstrap.min.css"
  />

  <!-- Font Awesome -->
  <link
    rel="stylesheet"
    href="css/all.min.css"
  />

  <!-- 自定义样式 -->
  <link rel="stylesheet" href="home.css" />
</head>
<body>
  <!-- 雪花覆盖层 -->
  <div class="weather-layer" id="weatherLayer"></div>
  <div class="snow-container"></div>
  <!-- 粒子背景容器 -->
  <div id="tsparticles" class="background"></div>

  <div class="wrapper">
    <div class="page-layout">
      <!-- 左侧功能栏 -->
      <nav class="sidebar">
        <div class="sidebar-top">
          <button id="btn-friends" class="sidebar-btn active" title="好友列表">
            <i class="fa-regular fa-user"></i>
          </button>
          <button id="btn-add" class="sidebar-btn" title="添加好友">
            <i class="fa-solid fa-user-plus"></i>
          </button>
        </div>
        
        <div class="weather-toggle">
          <button data-weather="snow" title="雪花">❄️</button>
          <button data-weather="rain" title="雨滴">🌧️</button>
          <button data-weather="cloud" title="云朵">☁️</button>
          <button data-weather="suncloud" title="太阳+云">⛅</button>
        </div>
      </nav>

      <div class="page-main">
        <!-- 头部 -->
        <header class="header">
          <h1 class="header-title">
            <a href="profile.html" id="avatarContainer" class="avatar-container" title="个人资料">
              <img id="avatar" class="header-avatar" src="upload/images/default_head.jpg" alt="头像" />
              <!-- <div class="avatar-tooltip">个人资料</div> -->
            </a>
            <span id="nickname">加载中~</span>
          </h1>

          <button id="logoutButton" class="btn-ghost">
            <i class="fa-solid fa-sign-out-alt"></i>
          </button>
        </header>

        <!-- 主区：两个面板，切换显示 -->
        <main class="container">
          <!-- 好友列表面板 -->
          <div class="container-inner">
            <section id="panel-friends" class="panel">
              <h2> 好友列表</h2>
              <ul id="friendList" class="friend-list list-unstyled"></ul>
            </section>

            <!-- 添加好友面板 -->
            <section id="panel-add" class="panel" style="display: none;">
              <h2> 添加好友</h2>
              <div class="add-friend">
                <input
                  type="text"
                  id="addFriendInput"
                  placeholder="输入好友 ID"
                />
                <button id="addFriendButton">添加</button>
              </div>
              <p id="addFriendMessage"></p>
            </section>
          </div>
        </main>
      </div>
    </div>
  </div>

  <!-- 好友资料模态框 -->
  <div class="modal fade" id="friendProfileModal" tabindex="-1" aria-labelledby="friendProfileModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="friendProfileModalLabel">好友资料</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <div class="profile-avatar-container">
            <img id="modalFriendAvatar" src="upload/images/default_head.jpg" alt="好友头像" class="profile-avatar">
          </div>
          
          <div class="profile-info-grid">
            <div class="profile-info-item">
              <span class="profile-info-label">用户ID</span>
              <div class="profile-info-value" id="modalFriendId"></div>
            </div>
            
            <div class="profile-info-item">
              <span class="profile-info-label">昵称</span>
              <div class="profile-info-value" id="modalFriendNickname"></div>
            </div>
            
            <div class="profile-info-item">
              <span class="profile-info-label">邮箱</span>
              <div class="profile-info-value" id="modalFriendEmail"></div>
            </div>
            
            <div class="profile-info-item">
              <span class="profile-info-label">性别</span>
              <div class="profile-info-value" id="modalFriendGender"></div>
            </div>
            
            <div class="profile-bio">
              <span class="profile-info-label">个人简介</span>
              <div class="profile-info-value" id="modalFriendBio"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- 库：粒子 / 动画 / 倾斜 -->
  <script src="js/axios.min.js" defer></script>
  <script src="js/tsparticles.bundle.min.js" defer></script>
  <script src="js/anime.min.js" defer></script>
  <script src="js/vanilla-tilt.min.js" defer></script>
  <script src="js/bootstrap.bundle.min.js" crossorigin="anonymous" defer></script>
  <script src="/socket.io/socket.io.js" defer></script>
  <script src="home.js" defer></script>

</body>
</html>
